public class Solution {
    public boolean isPalindrome(String s) {
        String S = s.toLowerCase();
        int len = S.length();
        int half = len % 2 == 0 ? len / 2 : len / 2 + 1;

        if((S.substring(0,half)).equals(S.substring(half - 1))){
            return true;
        }
        return false;
    }
}